package com.lagou.wang.service.student;

import com.lagou.wang.dao.student.StudentDao;


import com.lagou.wang.factory.DaoFactory;
import com.lagou.wang.pojo.Student;

import java.util.List;

/**
 * @author wanggege
 * StudentService实现类
 */
public class StudentServiceImpl implements StudentService {

    private StudentDao studentDao;

    public StudentServiceImpl() {
        this.studentDao= DaoFactory.getStudentDao();
    }

    @Override
    public List<Student> allStudent() {
        return studentDao.allStudent();
    }

    @Override
    public int addStudent(Student student) {
        return studentDao.addStudent(student);
    }

    @Override
    public int updateStudentById(Student student) {
        return studentDao.updateStudentById(student);
    }

    @Override
    public int deleteStudentById(int id) {
        return studentDao.deleteStudentById(id);
    }

    @Override
    public Student queryStudentById(int id) {
        return studentDao.queryStudentById(id);
    }

    @Override
    public Student queryStudentByName(String name) {
        return studentDao.queryStudentByName(name);
    }

    @Override
    public Student queryStudentByClassId(int cid) {
        return studentDao.queryStudentByClassId(cid);
    }
}
